/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.business.router.core.domain;

import info.peigen.hotpot.business.router.facade.Channel;
import info.peigen.hotpot.business.router.facade.enums.ReceiptStatus;
import info.peigen.hotpot.common.core.domain.DomainObject;
import info.peigen.hotpot.common.core.lang.money.Money;
import info.peigen.hotpot.common.core.util.IdUtil;
import jakarta.validation.constraints.NotEmpty;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;
import lombok.experimental.SuperBuilder;

import java.util.Date;
import java.util.List;

import static info.peigen.hotpot.business.router.facade.enums.ReceiptStatus.INIT;


/**
 * <b>(Receipt)</b>
 * 收款领域模型
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2022/5/17
 */
@EqualsAndHashCode(callSuper = true)
@SuperBuilder
@Data
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
public class Receipt extends DomainObject {
    @Builder.Default
    String receiptId = IdUtil.id();
    /** 交易Id */
    @NotEmpty
    String tradeId;
    /** 渠道唯一订单号 */
    String channelUniId;
    /** 状态 */
    @Builder.Default
    ReceiptStatus status = INIT;
    /** 收款渠道,定义收款的钱从哪里出去 */
    Channel              receiptChannel;
    /** 收款成功金额,到账币种 */
    Money                successAmount;
    /** 结算时间 */
    Date                 settleDate;
    /** 收费 */
    ReceiptFee           fee;
    List<RouterTransLog> receiptTransLogs;
    /** 渠道响应原始报文 */
    String               requestJson;
}
